<script lang="ts" setup>
import { ref, watch, computed,onMounted } from 'vue'
import { useAddUserStore } from '../../../store/addUser';
import { usePositionSelectStore } from '../../../store/positionSelect';
import position from '../../../api/position';
const addUserStore = useAddUserStore();
const positionSelectStore = usePositionSelectStore();
const prompt = computed(() => {
  return addUserStore.user.departmentId ? '请选择职位' : '请先选择部门';
});
// 监听部门ID变化，自动加载岗位数据
onMounted(async() => {
  
});
</script>
<template>
  <el-select :disabled="!addUserStore.user.departmentId" v-model="addUserStore.user.positionId" clearable
    :placeholder="prompt" style="width: 240px">
    <el-option v-for="item in positionSelectStore.positionSelect" :key="item.value" :label="item.label"
      :value="item.value" />
  </el-select>
</template>